import request from '@/utils/request'

export default {
  listAll() {
    return request({
      url: '/admin/all',
      method: 'get'
    })
  },
  listPage(currentPage, pageSize, queryAdminDTO) {
    return request({
      url: `/admin/search/${currentPage}/${pageSize}`,
      method: 'post',
      data: queryAdminDTO
    })
  },
  deleteAdmin(ids) {
    return request({
      url: `/admin/delete`,
      method: 'delete',
      data: ids
    })
  },
  addAdmin(admin) {
    return request({
      url: `/admin/add`,
      method: 'post',
      data: admin
    })
  },
  updateAdmin(admin) {
    return request({
      url: `/admin/update`,
      method: 'put',
      data: admin
    })
  },
  selectAdminById(id) {
    return request({
      url: `/admin/search/${id}`,
      method: 'get'
    })
  },
  selectAdminByName(name) {
    return request({
      url: `/admin/searchByName/${name}`,
      method: 'get'
    })
  }
}

